<!DOCTYPE html>
<!--conf
<sample>
              <product version="4.0b1" edition="std"/>
                     <modifications>
                            <modified date="130911"/>
                     </modifications>
               </sample>
-->
<html>
<head>
	<title>onToolbarClick with dhtmlxToolbar</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
	<style>
		 div#editorObj {
		 	 width: 100%;
		 	 height: 300px;
		 	 border: 1px solid #a4bed4;
		 }
		 div#logsHere {
			position: relative;
			height: 100px;
			border: #dddddd 1px solid;
			padding: 4px;
			margin: 30px 10px 10px 10px;
			font-size: 12px;
			font-family: Tahoma;
			overflow: auto;
		}
	</style>
	<script>
		var myEditor;
		function doOnLoad() {
			myEditor = new dhtmlXEditor({
				parent: "editorObj",
				toolbar: true,
				iconsPath: "../../../codebase/imgs/",
				content: 'The <b>DHTMLX</b> suite (or <b>dhtmlxSuite</b>) is a <a href="http://en.wikipedia.org/wiki/JavaScript" title="JavaScript">JavaScript</a> '+
						'<a href="http://en.wikipedia.org/wiki/GUI_widget" title="GUI widget">GUI widget</a> library for building dynamic '+
						'<a href="http://en.wikipedia.org/wiki/Web_applications" title="Web applications" class="mw-redirect">web applications</a> with desktop-like user experience '+
						'and <a href="http://en.wikipedia.org/wiki/Ajax_%28programming%29" title="Ajax (programming)">Ajax</a> data loading. '+
						'The library is released under both <a href="http://en.wikipedia.org/wiki/Open-source" title="Open-source" class="mw-redirect">open-source</a> '+
						'<a href="http://en.wikipedia.org/wiki/GNU_General_Public_License" title="GNU General Public License">GNU General Public License</a> and commercial licenses. '+
						'Modular architecture of the library allows using the components as separate blocks or combining them into a common Ajax-based interface.'
			});
			myEditor.attachEvent("onToolbarClick", function(name){
				writeLog("onToolbarClick event fired, name: <b>"+name+"</b>");
			});
		}
		function writeLog(text) {
			document.getElementById("logsHere").innerHTML += "<br>"+text;
			document.getElementById("logsHere").scrollTop = document.getElementById("logsHere").scrollHeight;
		}
	</script>
</head>
<body onload="doOnLoad();">
	<div id="editorObj"></div>
	<div id="logsHere">Logs here:</div>
</body>
</html>